Skip to content

Conversation

@jonatanklosko
Copy link
Member

bytes are immutable and PyBytes_AsStringAndSize returns pointer to the buffer. Similarly str are immutable and PyUnicode_AsUTF8AndSize returns a pointer to cached buffer that lives as long as the object.

Currently we create a new Erlang binary, which means copying the data once. This PR changes it such that we create resource around the Python objects and create a zero-copy resource binary term.

@jonatanklosko jonatanklosko merged commit ece1b80 into main Mar 7, 2025
9 checks passed
@jonatanklosko jonatanklosko deleted the jk-binaries branch March 7, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants